package org.easychat.mq;

import org.springframework.amqp.core.AmqpTemplate;

import javax.annotation.Resource;
import java.util.Date;

/**
 * @Description 发送者
 * @Author Deyun
 * @Date 2024/4/27 15:06
 */
public class RabbitMQSender {

    @Resource
    private AmqpTemplate rabbitTemplate;


    public void sendMessage() {
        String context = "hello " + new Date();
        this.rabbitTemplate.convertAndSend("hello", context);
    }
}
